<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Embroidermodder: extern/libembroidery/src/compress.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  extensions: ["tex2jax.js", "TeX/AMSmath.js"],
  jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="logo_embroidermodder_2_0.png"/></td>
  <td id="projectalign">
   <div id="projectname">Embroidermodder<span id="projectnumber">&#160;2.0.0-alpha4</span>
   </div>
   <div id="projectbrief">A free and open source software for machine embroidery</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('compress_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle"><div class="title">compress.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;<a class="el" href="embroidery__internal_8h_source.html">embroidery_internal.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a053addffe32629b6727073e9c499cc32"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a053addffe32629b6727073e9c499cc32">hus_compress</a> (char *data, int length, char *output, int *output_length)</td></tr>
<tr class="separator:a053addffe32629b6727073e9c499cc32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e5d1d3488d7124ab020287e2606f89d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a7e5d1d3488d7124ab020287e2606f89d">huffman_build_table</a> (<a class="el" href="embroidery__internal_8h.html#a8ad0df962f28b81981b3b0b7f04ebb17">huffman</a> *h)</td></tr>
<tr class="separator:a7e5d1d3488d7124ab020287e2606f89d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04af50a7e18d0e4d85ae76c7c4bd80d9"><td class="memItemLeft" align="right" valign="top">int *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a04af50a7e18d0e4d85ae76c7c4bd80d9">huffman_lookup</a> (<a class="el" href="embroidery__internal_8h.html#a8ad0df962f28b81981b3b0b7f04ebb17">huffman</a> h, int byte_lookup)</td></tr>
<tr class="separator:a04af50a7e18d0e4d85ae76c7c4bd80d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2630b57677982cec1d413de85c262fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#ac2630b57677982cec1d413de85c262fd">compress_init</a> ()</td></tr>
<tr class="separator:ac2630b57677982cec1d413de85c262fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed62fb2531905dbb3a075afb3912c50e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#aed62fb2531905dbb3a075afb3912c50e">compress_get_bits</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c, int length)</td></tr>
<tr class="separator:aed62fb2531905dbb3a075afb3912c50e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af511532a8a7f9f6646379e8fbb472331"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#af511532a8a7f9f6646379e8fbb472331">compress_pop</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c, int bit_count)</td></tr>
<tr class="separator:af511532a8a7f9f6646379e8fbb472331"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaeb1b13beaf29fad4611aca96a32b499"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#aaeb1b13beaf29fad4611aca96a32b499">compress_peek</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c, int bit_count)</td></tr>
<tr class="separator:aaeb1b13beaf29fad4611aca96a32b499"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb74b97766d1968313b6e637032e9686"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#afb74b97766d1968313b6e637032e9686">compress_read_variable_length</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:afb74b97766d1968313b6e637032e9686"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa237ee1cf527ebb720fccf48495179e1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#aa237ee1cf527ebb720fccf48495179e1">compress_load_character_length_huffman</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:aa237ee1cf527ebb720fccf48495179e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39e722c76e45536e81a47b35c349eb79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a39e722c76e45536e81a47b35c349eb79">compress_load_character_huffman</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:a39e722c76e45536e81a47b35c349eb79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7830b6991ed529226a1a7252d29b401e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a7830b6991ed529226a1a7252d29b401e">compress_load_distance_huffman</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:a7830b6991ed529226a1a7252d29b401e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58b1553ebfc0984e0d9ef74bcbb14c0c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a58b1553ebfc0984e0d9ef74bcbb14c0c">compress_load_block</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:a58b1553ebfc0984e0d9ef74bcbb14c0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a9394d4a8d2bd617070539667405633"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a8a9394d4a8d2bd617070539667405633">compress_get_token</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:a8a9394d4a8d2bd617070539667405633"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61b95342f1dbd1e438079d87b3837da6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#a61b95342f1dbd1e438079d87b3837da6">compress_get_position</a> (<a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *c)</td></tr>
<tr class="separator:a61b95342f1dbd1e438079d87b3837da6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5370ff498be6c8a440bb0a581c2ed5c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#aa5370ff498be6c8a440bb0a581c2ed5c">hus_decompress</a> (char *data, int length, char *output, int *output_length)</td></tr>
<tr class="separator:aa5370ff498be6c8a440bb0a581c2ed5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:af0a0646ec730d0abdffced84a07f845e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="compress_8c.html#af0a0646ec730d0abdffced84a07f845e">huffman_lookup_data</a> [2]</td></tr>
<tr class="separator:af0a0646ec730d0abdffced84a07f845e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >This is a work in progress.</p>
<p >Thanks to Jason Weiler for describing the binary formats of the HUS and VIP formats at:</p>
<p ><a href="http://www.jasonweiler.com/HUSandVIPFileFormatInfo.html">http://www.jasonweiler.com/HUSandVIPFileFormatInfo.html</a></p>
<p >Further thanks to github user tatarize for solving the mystery of the compression in:</p>
<p ><a href="https://github.com/EmbroidePy/pyembroidery">https://github.com/EmbroidePy/pyembroidery</a></p>
<p >with a description of that work here:</p>
<p ><a href="https://stackoverflow.com/questions/7852670/greenleaf-archive-library">https://stackoverflow.com/questions/7852670/greenleaf-archive-library</a></p>
<p >This is based on their work. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="aed62fb2531905dbb3a075afb3912c50e" name="aed62fb2531905dbb3a075afb3912c50e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed62fb2531905dbb3a075afb3912c50e">&#9670;&nbsp;</a></span>compress_get_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int compress_get_bits </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> <em>length</em> Returns . </p>

</div>
</div>
<a id="a61b95342f1dbd1e438079d87b3837da6" name="a61b95342f1dbd1e438079d87b3837da6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61b95342f1dbd1e438079d87b3837da6">&#9670;&nbsp;</a></span>compress_get_position()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int compress_get_position </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> . Returns the position as an int. </p>

</div>
</div>
<a id="a8a9394d4a8d2bd617070539667405633" name="a8a9394d4a8d2bd617070539667405633"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a9394d4a8d2bd617070539667405633">&#9670;&nbsp;</a></span>compress_get_token()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int compress_get_token </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> . Returns the token as an int. </p>

</div>
</div>
<a id="ac2630b57677982cec1d413de85c262fd" name="ac2630b57677982cec1d413de85c262fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2630b57677982cec1d413de85c262fd">&#9670;&nbsp;</a></span>compress_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compress_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a58b1553ebfc0984e0d9ef74bcbb14c0c" name="a58b1553ebfc0984e0d9ef74bcbb14c0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a58b1553ebfc0984e0d9ef74bcbb14c0c">&#9670;&nbsp;</a></span>compress_load_block()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compress_load_block </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> . Returns nothing. </p>

</div>
</div>
<a id="a39e722c76e45536e81a47b35c349eb79" name="a39e722c76e45536e81a47b35c349eb79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39e722c76e45536e81a47b35c349eb79">&#9670;&nbsp;</a></span>compress_load_character_huffman()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compress_load_character_huffman </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Load character table to compress struct <em>c</em>. Returns nothing. </p>

</div>
</div>
<a id="aa237ee1cf527ebb720fccf48495179e1" name="aa237ee1cf527ebb720fccf48495179e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa237ee1cf527ebb720fccf48495179e1">&#9670;&nbsp;</a></span>compress_load_character_length_huffman()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compress_load_character_length_huffman </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> . Returns. </p>

</div>
</div>
<a id="a7830b6991ed529226a1a7252d29b401e" name="a7830b6991ed529226a1a7252d29b401e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7830b6991ed529226a1a7252d29b401e">&#9670;&nbsp;</a></span>compress_load_distance_huffman()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void compress_load_distance_huffman </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> . Returns nothing. </p>

</div>
</div>
<a id="aaeb1b13beaf29fad4611aca96a32b499" name="aaeb1b13beaf29fad4611aca96a32b499"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaeb1b13beaf29fad4611aca96a32b499">&#9670;&nbsp;</a></span>compress_peek()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int compress_peek </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bit_count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> <em>bit_count</em>. Returns. </p>

</div>
</div>
<a id="af511532a8a7f9f6646379e8fbb472331" name="af511532a8a7f9f6646379e8fbb472331"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af511532a8a7f9f6646379e8fbb472331">&#9670;&nbsp;</a></span>compress_pop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int compress_pop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bit_count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em> <em>bit_count</em> . Returns. </p>

</div>
</div>
<a id="afb74b97766d1968313b6e637032e9686" name="afb74b97766d1968313b6e637032e9686"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb74b97766d1968313b6e637032e9686">&#9670;&nbsp;</a></span>compress_read_variable_length()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int compress_read_variable_length </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a0a1ded23c1c333067bcfb59d5b83ce2a">compress</a> *&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>c</em>. Returns. </p>

</div>
</div>
<a id="a7e5d1d3488d7124ab020287e2606f89d" name="a7e5d1d3488d7124ab020287e2606f89d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e5d1d3488d7124ab020287e2606f89d">&#9670;&nbsp;</a></span>huffman_build_table()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void huffman_build_table </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a8ad0df962f28b81981b3b0b7f04ebb17">huffman</a> *&#160;</td>
          <td class="paramname"><em>h</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >These next 2 functions represent the <a class="el" href="structHuffman.html">Huffman</a> class in tartarize's code. <em>h</em> </p>

</div>
</div>
<a id="a04af50a7e18d0e4d85ae76c7c4bd80d9" name="a04af50a7e18d0e4d85ae76c7c4bd80d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04af50a7e18d0e4d85ae76c7c4bd80d9">&#9670;&nbsp;</a></span>huffman_lookup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int * huffman_lookup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery__internal_8h.html#a8ad0df962f28b81981b3b0b7f04ebb17">huffman</a>&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>byte_lookup</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Lookup <em>byte_lookup</em> in huffman table <em>h</em> return result as two bytes using the memory huffman_lookup_data. </p>

</div>
</div>
<a id="a053addffe32629b6727073e9c499cc32" name="a053addffe32629b6727073e9c499cc32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a053addffe32629b6727073e9c499cc32">&#9670;&nbsp;</a></span>hus_compress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hus_compress </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>output_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>data</em> <em>length</em> <em>output</em> <em>output_length</em> . Returns whether it was successful as an int.</p>
<p >This avoids the now unnecessary compression by placing a minimal header of 6 bytes and using only literals in the huffman compressed part (see the sources above). </p>

</div>
</div>
<a id="aa5370ff498be6c8a440bb0a581c2ed5c" name="aa5370ff498be6c8a440bb0a581c2ed5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5370ff498be6c8a440bb0a581c2ed5c">&#9670;&nbsp;</a></span>hus_decompress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hus_decompress </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>output_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>data</em> <em>length</em> <em>output</em> <em>output_length</em> . Returns whether the decompression was successful. </p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="af0a0646ec730d0abdffced84a07f845e" name="af0a0646ec730d0abdffced84a07f845e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0a0646ec730d0abdffced84a07f845e">&#9670;&nbsp;</a></span>huffman_lookup_data</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int huffman_lookup_data[2]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_dc9e1e299a0b26f222fe6c0a872463f0.html">extern</a></li><li class="navelem"><a class="el" href="dir_6a8aa8af2875e58e82a0145491f7a8e2.html">libembroidery</a></li><li class="navelem"><a class="el" href="dir_50a7dc5dba8160ac8332d90912e622db.html">src</a></li><li class="navelem"><a class="el" href="compress_8c.html">compress.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
